package io.renren.modules.mybog.fromControoler;


import io.renren.modules.mybog.fromControoler.utiles.QQ;
import io.renren.modules.mybog.fromControoler.utiles.R;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RequestMapping("/bolg/qq")
public class QQControolers {
    @Value("${spring.application.qq}")
    private  String path;
    /**
     * qq昵称获取接口
     * @param qq
     * @return
     */
       @GetMapping("/getName/{qq}")
       public R getQQname(@PathVariable("qq") String qq){
           HashMap map = QQ.getNickname(path+qq);
            //取出qq昵称
           Object name = map.get("name");
           return R.ok().data("qq",name);
       }
}
